export type DomainObject = {
  projeect: Project
  database: Database
  schemas: Schemas
  relations?: Relation[]
}

type Relation = {
  from: string
  to: string
  fromQty: string
  toQty: string
  arrow?: string
  type: string
}

export type Database = {
  url: string
  username: string
  password: string
  type: 'mysql' | 'oracle' | 'sqlserver' | 'db2' | 'postgresql'
}

export type Project = {
  name: string
  desc?: string
  version?: string
  packageName?: string
}

export type Schemas = { [key: string]: Schema }

export type Schema = {
  type: 'refObj' | 'valObj'
  required?: (keyof Properties)[]
  primarykey?: (keyof Properties)[]
  properties: Properties
  upperFirstCamelCaseName?: string
  camelCaseName?: string
  snakeCameName?: string
  kebabCaseName?: string
}

export type Properties = { [key: string]: Property }

export type Property = {
  type: 'integer' | 'string' | 'boolean'
  format?: 'int64' | 'int32'
  label: string
  description?: string
  enum?: string[]
  default?: any
  required?: boolean
  camelCaseName?: string
  snakeCaseName?: string
}
